﻿#region using statements

using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Media;

#endregion

namespace NGen.Managers.Audio
{
	public interface IManagerAudio2D : IGameManager
	{
		/// <summary>
		/// 	Get or set Song volume. 0.0 through 1.0
		/// </summary>
		float SongVolume { get; set; }

		/// <summary>
		/// 	Get or set sound effect volume. 0.0 through 1.0
		/// </summary>
		float SoundEffectVolume { get; set; }

		/// <summary>
		/// 	Get or set whether or not the song queue is looping
		/// </summary>
		bool IsLooping { get; set; }

		#region Playlist methods

		/// <summary>
		/// 	This method adds the specified song to the play queue
		/// </summary>
		/// <param name = "p_song">The song to be added to the que</param>
		void AddSongToQueue(Song p_song);

		/// <summary>
		/// 	This method will remove a song from the play queue.
		/// </summary>
		/// <param name = "p_song">The song to be removed</param>
		void RemoveSongFromQueue(Song p_song);

		/// <summary>
		/// 	This method will start the song queue if there are no songs currently playing
		/// </summary>
		void PlaySongPlaylist();

		/// <summary>
		/// 	This method will play the next song in the play queue
		/// </summary>
		void SongPlaylistSkipNext();

		/// <summary>
		/// 	This method will play the previous song in the play queue
		/// </summary>
		void SongPlaylistSkipPrevious();

		/// <summary>
		/// 	This method will clear the queue so that it can be repopulated with new songs
		/// </summary>
		void ClearPlaylist();

		#endregion

		#region Single Song methods

		/// <summary>
		/// 	Play a song, not from playlist
		/// </summary>
		/// <param name = "p_song">the name of the song</param>
		/// <param name = "p_loop">whether it loops or not</param>
		void PlaySong(Song p_song, bool p_loop = false);

		/// <summary>
		/// 	Stops the song (no resume available)
		/// </summary>
		void StopSong();

		/// <summary>
		/// 	Pauses the song
		/// </summary>
		void PauseSong();

		/// <summary>
		/// 	Resumes the paused song
		/// </summary>
		void ResumeSong();

		#endregion

		#region Soundeffect methods

		/// <summary>
		/// 	Plays a sound.  
		/// 	Note insure that the soundfile you are playing has the correct properties.
		/// 	i.e.  Content importer: mp3 audio
		/// 	Content processor: sound effect
		/// </summary>
		/// <param name = "p_soundName">name of the sound</param>
		SoundEffectInstance PlaySound(SoundEffect p_soundName);

		/// <summary>
		/// 	Plays a sound
		/// 	Note insure that the soundfile you are playing has the correct properties.
		/// 	i.e.  Content importer: mp3 audio
		/// 	Content processor: sound effect
		/// </summary>
		/// <param name = "p_soundName">name of the sound</param>
		/// <param name = "p_volume">volume (0.0f to 1.0f)</param>
		SoundEffectInstance PlaySound(SoundEffect p_soundName, float p_volume);

		/// <summary>
		/// 	Plays a sound
		/// 	Note insure that the soundfile you are playing has the correct properties.
		/// 	i.e.  Content importer: mp3 audio
		/// 	Content processor: sound effect
		/// </summary>
		/// <param name = "p_soundName">name of the sound</param>
		/// <param name = "p_volume">volume (0.0f [mute] to 1.0f [maximum])</param>
		/// <param name = "p_pitch">pitch (-1.0f [-1 octave] to 1.0f [+1 octave])</param>
		/// <param name = "p_pan">pan (-1.0f [left] to 1.0f [right]. 0.0f is center</param>
		/// <param name = "p_loop">whether the sound loops</param>
		/// <returns name = "temp">returns the created sound effect so that the user can stop it at their leasure</returns>
		SoundEffectInstance PlaySound(SoundEffect p_soundName, float p_volume, float p_pitch, float p_pan, bool p_loop);

		/// <summary>
		/// 	Pauses all of the currently playing sound effects
		/// </summary>
		void PauseAllSoundEffects();

		/// <summary>
		/// 	Resumes all paused sound effects
		/// </summary>
		void ResumeAllSoundEffects();

		/// <summary>
		/// 	Stops all sound effects
		/// </summary>
		void StopAllSoundEffects();

		#endregion
	}
}